
function main( json, pp, hh ) {
  
  

  /*
  var add = "http://www.askgeo.com/api/762007/tfgb4hm7h4c9iq2j8avpv40foo/";
  var p = "timezone.json?points=37.7,40.71";
  */
  
   var userObject = hh.getQueryParameters().getFirst("json");
   Log.debug(userObject);
   if ( userObject == null ){
        var ex = "{ exception: { message: 'no param provided'} }";
        return ex;
  }
  
  var json = null;
  try{
     json = new JSONObject( userObject );
  } catch ( e ){
      Log.debug("Error in getting params",e);
      var ex = "{ exception: { message: '" + e + "'} }";
      return ex;
  }
  
  var root;
  var param;
  
  try{
      root = json.get("root");
      param = json.get("param");
  } catch ( e ){
      Log.debug("Error in getting params" + e);
      var ex = "{ exception: { message: '" + e + "'} }";
      return ex;
  }
  

  var ret = null;
  try{
      var url = new java.net.URL(root + param);
      var u = url.openConnection();
      var inB = new java.io.BufferedReader( new java.io.InputStreamReader(u.getInputStream()));
      var inputLine;    
      var result = "";
 
      while ((inputLine = inB.readLine()) != null) 
            result += " " + inputLine;
      inB.close();         
      ret = new JSONObject(result);
  } catch( e ){
      Log.debug("Error calling service rest" + e);
      var ex = "{ exception: { message: '" + e + "'} }";
      return ex;
  }
  return ret;

}